<?php


namespace app\admin\validate;

class User extends Base
{
    protected $rule =   [
        'id'  => 'require',
        'ids'  => 'require',
        'nickname'  => 'require',
        'password'   => 'require',
        'repassword'   => 'require|confirm:password',
        'account'   => 'require|unique:user',
        'status' => 'require',
    ];

    protected $message  =   [
        'id.require' => 'id必须',
        'ids.require' => 'ids必须',
        'nickname.require' => '昵称必须',
        'password.require' => '密码必须',
        'repassword.require' => '确认密码必须',
        'account.require' => '账号必须',
        'account.unique' => '账号已存在',
        'status.require' => '状态必须',
    ];


    protected $scene = [
        'insert'  =>  ['nickname','password','repassword','account','status'],
        'update'  =>  ['id','nickname','password','repassword','account','status'],
        'detail'  =>  ['id'],
        'status'  =>  ['ids', 'status'],
        'del'  =>  ['ids'],
        'clean'  =>  ['ids'],
    ];
}